//https://leetcode.cn/problems/largest-number/

class Solution {
public:
    string largestNumber(vector<int>& nums) {
        //转换成字符串
        vector<string> str;
        for (auto e : nums)
        {
            str.push_back(to_string(e));
        }

        //排序
        sort(str.begin(), str.end(), [](string& s1, string& s2)
            {
                return s1 + s2 > s2 + s1;
            });

        string ret;
        for (auto s : str)
        {
            ret += s;
        }

        if (str[0] == "0") return "0";

        return ret;

    }
};